# 定义fixture完成用例的前后置操作
# 用例执行之前查看数据
# 用例执行之后关闭数据库
import pytest


@pytest.fixture(scope='function')
def e_x_t():
    print("连接数据库")
    yield
    print("关闭数据库")



# def foo():
#     print("starting...")
#     while True:
#         res = yield 4
#         print("res:",res)
# print(1)
# g = foo()
# print(next(g))
# print("*"*20)
# print(next(g))